package web.gkw.action;

import java.util.List;

import javax.annotation.Resource;

import web.gkw.model.Technique;
import web.gkw.service.TechniqueService;

import com.opensymphony.xwork2.ActionSupport;

public class Skill extends ActionSupport {
	
	@Resource
	private TechniqueService techniqueService;
	private int page;
	private int resNum;

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getResNum() {
		return resNum;
	}

	public void setResNum(int resNum) {
		this.resNum = resNum;
	}

	public TechniqueService getTechniqueService() {
		return techniqueService;
	}

	public void setTechniqueService(TechniqueService techniqueService) {
		this.techniqueService = techniqueService;
	}
	
	private List<Technique> list;
	
	public List<Technique> getList() {
		return list;
	}

	public void setList(List<Technique> list) {
		this.list = list;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		
		resNum = techniqueService.getCount();
		
		if(page == 0) {
			page = 1;
		}
		
		list = techniqueService.getFirstList(page);
		
		return "success";
	}
	
}
